package com.shop.controller;

import com.shop.entity.Buyer;
import com.shop.entity.Result;
import com.shop.service.BuyerManagerService;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * description: 会员的登陆注册等
 *
 * @author zhaoxiaozhao（xiaozhao.zhao@ucarinc.com）
 * @version 1.0
 * @date 2018/10/19 17:26
 **/
@Controller
@RequestMapping("/sellerManager")
public class SellerManagerController {

    @Resource
    private BuyerManagerService buyerManagerService;
    /**
     * description:<会员注册的页面>
     *
     * @author zhaoxiaozhao（xiaozhao.zhao@ucarinc.com）
     * @date   2018/10/19 17:33
     * @param  
     * @return 
     **/
    @RequestMapping("/register")
    public String register(){
        return "register";
    }
    /**
     * description:<会员注册>
     *
     * @author zhaoxiaozhao（xiaozhao.zhao@ucarinc.com）
     * @date   2018/10/19 17:32
     * @param  buyer 会员信息
     * @return 
     **/
    @RequestMapping("/doRegister")
    @ResponseBody
    public Result doRegister(Buyer buyer){
          return buyerManagerService.addBuyer(buyer);
    }
}
